#pragma once

#include "lg.h"
#include "lg_init.h"
#include "lg_ref.h"



struct LGCanvas{
    LGRef ref;
    unsigned width;
    unsigned height;
    LGVector color;
    LGMatrix projection;
    LGMatrix view;
};

struct LGCanvasBackend {
    size_t(*sizeofCanvas)();
    int (*newCanvas)(LGCanvas* canvas);
    int (*newWindowCanvas)(LGCanvas* canvas);
    void (*freeCanvas)(LGCanvas* canvas);
    void (*clearCanvas)(LGCanvas* canvas);
    void (*renderCanvas)(LGCanvas* canvas);
};

LG_API int
lgInitCanvasContext(LGConfig* config, LGCanvasBackend* backend);
